package com.qingke.OMS.Command.Imp;

import java.util.List;

import com.qingke.OMS.Command.Command;
import com.qingke.OMS.Dao.GoodsDao;
import com.qingke.OMS.Pojo.Goods;
import com.qingke.OMS.Unit.Console;

public class checkGoodsByCgid implements Command{

	@Override
	public void execute() {
		 
	GoodsDao gdao = new GoodsDao();
	int cgid = Console.askUserInputInt("Please enter what's goods' category_id?");
	
		Goods goods = new Goods();
		goods.setCategory_id(cgid);
		List<Goods> gs = gdao.getGoodsByCgid(cgid);
		if(gs==null){
	    	Console.println("no goods!");
	        return ;
	    }
	 for (Goods good2 : gs) {
		System.out.println(good2);
	}
		
	}

	
}
